/**
 * Copyright 2018 asiainfo Inc.
 **/
package com.myz.app.shiro.session;

import com.myz.app.utils.RedisUtil;

/**
 * @author maoyz on 2018/6/12
 * @version: v1.0
 */
public class RedisManager {

  /**
   * redis操作工具类
   */
  private RedisUtil redisUtil;

  private Long expire;

  public RedisUtil getRedisUtil() {
    return redisUtil;
  }

  public void setRedisUtil(RedisUtil redisUtil) {
    this.redisUtil = redisUtil;
  }

  public void set(byte[] key, byte[] val, long expire) {
    redisUtil.set(key, val, expire);
  }

  public void set(String key, String val, long expire) {
    redisUtil.set(key, val, expire);
  }

  public long getExpire() {
    return expire;
  }

  public void setExpire(Long expire) {
    this.expire = expire;
  }

  public byte[] get(byte[] key) {
    return redisUtil.get(key);
  }

  public String get(String key) {
    return (String) redisUtil.get(key);
  }

  public void delete(byte[] key) {
    redisUtil.del(key);
  }
}
